home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / cgazv4n2.zip / HPDESC.H < prev    next >
Text File  |  1989-09-24  |  4KB  |  72 lines

  1. /*--------------------------------------------------------------------*/
  2. /*                      H P D E S C . H                               */
  3. /*--------------------------------------------------------------------*/
  4. /* FILE:         HPDESC.H                                             */
  5. /* DESCRIPTION:  Header file defining font and char descriptors       */
  6. /* COMPILER(s):  Borland 2.0+, MS 5.0+, Zortech C/C++                 */
  7. /* AUTHOR:       Marv Luse, Ithaca Street Software, Inc.              */
  8. /* DATE:         Sept, 1989                                           */
  9. /* COPYRIGHT:    Uses freely but acknowledge source.                  */
  10. /*--------------------------------------------------------------------*/
  11.  
  12. typedef struct
  13. _font_desc                         /* font descriptor */
  14.     {
  15.     unsigned int   fd_size;        /* font descriptor size */
  16.              char  resv_1;         /* reserved */
  17.     unsigned char  font_type;      /* font type */
  18.              int   resv_2;         /* reserved */
  19.     unsigned int   bl_dist;        /* baseline distance */
  20.     unsigned int   cell_width;     /* cell width */
  21.     unsigned int   cell_height;    /* cell height */
  22.     unsigned char  orient;         /* 0 = portrait, 1=landscape */
  23.     unsigned char  proportional;   /* 0=fixed, 1=proportional */
  24.     unsigned int   sym_set;        /* symbol set */
  25.     unsigned int   pitch;          /* pitch */
  26.     unsigned int   height;         /* height */
  27.     unsigned int   xheight;        /* x height */
  28.              char  wid_typ;        /* width type */
  29.     unsigned char  style;          /* style */
  30.              char  stroke_weight;  /* stroke weight */
  31.     unsigned char  typeface;       /* typeface */
  32.              char  resv_3;         /* reserved */
  33.     unsigned char  serif_style;    /* serif style */
  34.              int   resv_4;         /* reserved */
  35.              char  ul_dist;        /* underline distance */
  36.     unsigned char  ul_height;      /* underline height */
  37.     unsigned int   txt_height;     /* text height */
  38.     unsigned int   txt_width;      /* text width */
  39.              int   resv_5;         /* reserved */
  40.              int   resv_6;         /* reserved */
  41.     unsigned char  pitch_ext;      /* pitch extended */
  42.     unsigned char  height_ext;     /* height extended */
  43.              int   resv_7;         /* reserved */
  44.              int   resv_8;         /* reserved */
  45.              int   resv_9;         /* reserved */
  46.              char  font_name[16];  /* font name - this field's length */
  47.                                    /* and contents can vary: the font */
  48.                                    /* desc seq implies actual length. */
  49.     }
  50. font_desc;
  51.  
  52. typedef struct
  53. _char_desc                         /* char descriptor */
  54.     {
  55.     unsigned char  format;         /* use 4 for LJ II */
  56.              char  continue_flag;  /* only used for multi-desc chars */
  57.     unsigned char  desc_size;      /* use 14 */
  58.     unsigned char  desc_class;     /* use 1 */
  59.     unsigned char  orient;         /* 0=Portrait, 1=Landscape */
  60.              char  resv_1;         /* reserved */
  61.              int   left_ofs;       /* offset to left edge of char */
  62.              int   top_ofs;        /* offset to top of char */
  63.     unsigned int   char_width;     /* width in dots */
  64.     unsigned int   char_height;    /* height in dots */
  65.              int   delta_x;        /* left_ofs + char_width */
  66.           /* char  data[?]; */     /* place holder for char bitmap */
  67.     }
  68. char_desc;
  69.  
  70. /* macro to swap bytes in a 16-bit int, signed or unsigned */
  71. #define HL2LH( v )   ( (v << 8) | ((v >> 8) & 0x00FF) )
  72.